package net.chrisrichardson.ec2deployer.cluster

import net.chrisrichardson.ec2deployer.testutil.AWSPropertiesUtil
import net.chrisrichardson.ec2deployer.core.AWSProperties
import net.chrisrichardson.ec2deployer.core.EC2

class ClusterInstanceIntegrationTest extends GroovyTestCase {

    ClusterSpec spec
    EC2 ec2

    void setUp() {
        AWSProperties awsProperties = AWSPropertiesUtil.makeAWSProperties()
        ec2 = new EC2(awsProperties)
        spec = new ClusterSpec()
    }

    public void testConfigureSecurityGroups_none() {
        ClusterInstance clusterInstance = new ClusterInstance(ec2, spec)
        clusterInstance.configureSecurityGroups()
    }

    public void testConfigureSecurityGroups_prefix() {
        spec.withSecurityGroupPrefix("testgroups")
        ClusterInstance clusterInstance = new ClusterInstance(ec2, spec)
        clusterInstance.configureSecurityGroups()
    }

}